<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改【请填写功能名称】')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-cashorder-edit" th:object="${sysCashorder}">
            <input name="orderid" th:field="*{orderid}" type="hidden">


            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label">付款单号：</label>
                    <div class="col-sm-8">
                        <input name="tradeno" th:field="*{tradeno}" class="form-control" type="text">
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label">付款金额：</label>
                    <div class="col-sm-8">
                        <input name="tradecash" th:field="*{tradecash}" class="form-control" type="text">
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label">付款日期：</label>
                    <div class="col-sm-8">
                        <div class="input-group date">
                            <input name="tradedate" th:value="${#dates.format(sysCashorder.tradedate, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
                            <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label">付款备注：</label>
                    <div class="col-sm-8">
                        <input name="tradedesc" th:field="*{tradedesc}" class="form-control" type="text">
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label">是否打款：</label>
                    <div class="col-sm-8">
                        <select id="tradestate" class="form-control">
                            <option  value="0"  th:selected="${sysCashorder.tradestate}==0">未打款</option>
                            <option  value="1"  th:selected="${sysCashorder.tradestate}==1"  >已打款</option>
                        </select>
                    </div>
                </div>
            </div>

            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label">状态：</label>
                    <div class="col-sm-8">
                        <select id="state" class="form-control">
                            <option  value="0"  th:selected="${sysCashorder.state}==0">待审核</option>
                            <option  value="1"  th:selected="${sysCashorder.state}==1"  >审核通过</option>
                            <option  value="-1"  th:selected="${sysCashorder.state}==1"  >审核未过</option>
                        </select>
                    </div>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script th:inline="javascript">
        var prefix = ctx + "system/cashorder";
        $("#form-cashorder-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                var data = $('#form-cashorder-edit').serializeArray();
                $.operate.save(prefix + "/edit", data);
                var state = $.form.selectSelects("state");
                var transtate = $.form.selectSelects("tradestate");
                data.push({"name": "tradestate", "value": transtate});
                data.push({"name": "state", "value": state});
                $.operate.save(prefix + "/edit", data);
            }
        }

        $("input[name='tradedate']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

    </script>
</body>
</html>